{include file="index/header" /}
{include file="index/banner" /}
<div class="container">
    <div class="row">
        <div class="col-md-8"  id="arc_box">
        <h3 data-arcid="{$arc.id}" class="arc_title">标题：{$arc.title}
            <small>(作者：{$arc.author})</small>
            <small>(浏览量：{$arc.browse_num})</small>
            <small id="praise_num">(点赞次数：{$arc.praise_num})</small>

            <img src="/static/index/images/praise.svg" id="praise" width="20" style="margin-left: 10px;cursor: pointer"/>
        </h3>
        <script>
            var flag = false;
            $('#praise').click(function(){
                var id = $('.arc_title').attr('data-arcid');
                if(!flag){
                    $('#praise').attr({'src' : '/static/index/images/praise2.svg'});
                    flag = true;
                    $.ajax({
                        type : 'post',
                        data : {'id' : id},
                        url : "{:url('index/index/praise')}",
                        success : function(data){
                            $('#praise_num').html('(点赞次数：'+data+')');
                        }
                    });
                }else{
                    $('#praise').attr({'src' : '/static/index/images/praise.svg'});
                    flag = false;
                    $.ajax({
                        type : 'post',
                        data : {'id' : id},
                        url : "{:url('index/index/cutPraise')}",
                        success : function(data){
                            $('#praise_num').html('(点赞次数：'+data+')');
                        }
                    });
                }

            });
        </script>
        <hr>
        {$data.content}

        </div>
        <div class="col-md-4">
            {include file="index/right" /}
        </div>

    </div>
</div>
{include file="index/footer" /}
